Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download raw images for flasher type devices #77

Merged

Conversation

rahul-thakoor
Copy link
Contributor

No description provided.

@rahul-thakoor
Copy link
Contributor Author

successfully downloads a raw image

2024-05-02 13:42:59 INFO  Selected version 5.1.50+rev1 for download
2024-05-02 13:42:59 INFO  Downloading Balena OS image, selected version is: '5.1.50+rev1'
2024-05-02 13:42:59 DEBUG [takeover::stage1::api_calls] Downloading raw image for device type generic-amd64
2024-05-02 13:42:59 DEBUG [takeover::stage1::api_calls] get_os_image: request_url: 'https://api.balena-cloud.com/download'
2024-05-02 13:42:59 DEBUG [takeover::stage1::api_calls] get_os_image: data: 'ImageRequestData { device_type: "generic-amd64", version: "5.1.50+rev1", file_type: ".gz", image_type: Some("raw") }'
2024-05-02 13:43:00 DEBUG [reqwest::connect] starting new connection: https://api.balena-cloud.com/
2024-05-02 13:43:01 DEBUG [takeover::stage1::api_calls] Result = Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.balena-cloud.com")), port: None, path: "/download", query: None, fragment: None }, status: 200, headers: {"date": "Thu, 02 May 2024 13:43:01 GMT", "content-type": "application/octet-stream", "content-length": "577393095", "connection": "keep-alive", "vary": "X-HTTP-Method-Override", "access-control-allow-origin": "*", "access-control-allow-methods": "GET, PUT, POST, PATCH, DELETE, OPTIONS, HEAD", "access-control-allow-headers": "Content-Type, Authorization, Application-Record-Count, MaxDataServiceVersion, X-Requested-With", "access-control-allow-credentials": "true", "access-control-max-age": "86400", "content-disposition": "attachment; filename=\"generic-amd64-5.1.50+rev1-v16.1.0.img.gz\"", "x-transfer-length": "577393095", "cache-control": "no-store, no-transform", "cf-cache-status": "DYNAMIC", "strict-transport-security": "max-age=15552000", "server": "cloudflare", "cf-ray": "87d8701188253877-MRU", "alt-svc": "h3=\":443\"; ma=86400"} }
2024-05-02 13:43:01 DEBUG [takeover::stage1::image_retrieval] Downloading file '/mnt/data/balena-cloud-generic-amd64-5.1.50+rev1.img.gz'
2024-05-02 13:43:11 INFO  87 MiB read in 10 seconds @8918 KiB/sec 
2024-05-02 13:43:21 INFO  177 MiB read in 20 seconds @9093 KiB/sec 
2024-05-02 13:43:31 INFO  262 MiB read in 30 seconds @8966 KiB/sec 
2024-05-02 13:43:41 INFO  350 MiB read in 40 seconds @8971 KiB/sec 
2024-05-02 13:43:51 INFO  437 MiB read in 50 seconds @8964 KiB/sec 
2024-05-02 13:44:01 INFO  523 MiB read in 60 seconds @8931 KiB/sec 
2024-05-02 13:44:04 INFO  550 MiB read in 63 seconds @8950 KiB/sec 
2024-05-02 13:44:04 INFO  The balena OS image was successfully written to '/mnt/data/balena-cloud-generic-amd64-5.1.50+rev1.img.gz'
2024-05-02 13:44:04 DEBUG [takeover::stage1::migrate_info] image path: '/mnt/data/balena-cloud-generic-amd64-5.1.50+rev1.img.gz'

@rahul-thakoor rahul-thakoor force-pushed the rahul/download-raw-images-for-flasher-type-devices branch 3 times, most recently from ff1a530 to ac7f15e Compare May 3, 2024 14:05
- removes hardcoded list of devices that have flasher type os images and adds an api call to determine if device type has flasher type os image
- remove `extract_image` function which is no longer needed since we download raw images

Change-type: minor
Signed-off-by: Rahul Thakoor <[email protected]>
@rahul-thakoor rahul-thakoor force-pushed the rahul/download-raw-images-for-flasher-type-devices branch from ac7f15e to c2ee65c Compare May 6, 2024 12:04
@rahul-thakoor rahul-thakoor marked this pull request as ready for review May 6, 2024 12:08
@rahul-thakoor rahul-thakoor requested review from acostach and lmbarros May 6, 2024 12:09
@flowzone-app flowzone-app bot enabled auto-merge May 6, 2024 12:14
@rahul-thakoor
Copy link
Contributor Author

Closes #59

@acostach
Copy link
Contributor

acostach commented May 7, 2024

Tested successfully on an Intel NUC to Generic AMD64 migration. Device-type was also succesfully changed to "Generic x86_64 (GPT)" in config.json and in the dashboard.

@rahul-thakoor
Copy link
Contributor Author

@balena-ci I self-certify!

@flowzone-app flowzone-app bot merged commit 4bfc999 into master May 8, 2024
53 checks passed
@flowzone-app flowzone-app bot deleted the rahul/download-raw-images-for-flasher-type-devices branch May 8, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants